export default {
    namespaced: true,
    state: {
        isShowToast: false,
        toastMsg: '',
        toastType:''
    },
    mutations: {
        changeIsShowToast(state, payload) {
            state.isShowToast = payload.isShow
            if (payload.isShow) {
                state.toastMsg = payload.msg
                state.toastType = payload.type
            }
        }
    },
    actions: {
        asyncchangeIsShowToast(contxet, payload) {
            // console.log('asyncchangeIsShowToast');
            contxet.commit('changeIsShowToast', payload)
            setTimeout(() => {
                contxet.commit('changeIsShowToast', {
                    isShow:false
                })
            },1500)
        }
    }
}